package riot.challenge.java.tests;

import static org.junit.Assert.*;

import org.junit.Before;
import org.junit.Test;

import riot.challenge.java.interfaces.IHistoricalPlayerStatistics;
import riot.challenge.java.statistics.HistoricalPlayerStatistics;

public class HistoricalPlayerStatisticsTests {

	IHistoricalPlayerStatistics hps;
	int actual;
	int expected;
	int delta;
	
	@Before 
	public void init() {
		hps = new HistoricalPlayerStatistics();
		expected = 0;
		actual = -1;
		delta = 0;
	}
	
	@Test
	public final void testGetWin() {
		actual = hps.getWin();
		assertEquals(expected, actual, delta);
	}

	@Test
	public final void testSetWin() {
		expected = 2;
		hps.setWin(expected);
		actual = hps.getWin();
		assertEquals(expected, actual, delta);
	}

	@Test
	public final void testGetLost() {
		actual = hps.getLost();
		assertEquals(expected, actual, delta);
	}

	@Test
	public final void testSetLost() {
		expected = 2;
		hps.setLost(expected);
		actual = hps.getLost();
		assertEquals(expected, actual, delta);
	}

	@Test
	public final void testGetTotalNumberOfGamePlayed() {
		actual = hps.getTotalNumberOfGamePlayed();
		assertEquals(expected, actual, delta);
	}

	@Test
	public final void testSetTotalNumberOfGamePlayed() {
		expected = 2;
		hps.setTotalNumberOfGamePlayed(expected);
		actual = hps.getTotalNumberOfGamePlayed();
		assertEquals(expected, actual, delta);
	}

	@Test
	public final void testGetTotalDurationOfGamePlayed() {
		long actual2 = hps.getTotalDurationOfGamePlayed();
		assertEquals(expected, actual2, delta);
	}

	@Test
	public final void testSetTotalDurationOfGamePlayed() {
		expected = 2;
		hps.setTotalDurationOfGamePlayed(expected);
		long actual2 = hps.getTotalDurationOfGamePlayed();
		assertEquals(expected, actual2, delta);
	}

	@Test
	public final void testGetTotalNumberOfKills() {
		actual = hps.getTotalNumberOfKills();
		assertEquals(expected, actual, delta);
	}

	@Test
	public final void testSetTotalNumberOfKills() {
		expected = 2;
		hps.setTotalNumberOfKills(expected);
		actual = hps.getTotalNumberOfKills();
		assertEquals(expected, actual, delta);
	}

}
